package top.swimmer.tokenizer.dictionary;

/**
 * Created by xiaoyou on 16-12-11.
 */
public class DictionaryFactory {
    private DictionaryFactory() {}

    private static ArrayListDictionary arrayListDictionary = null;
    private static LinkedListDictionary linkedListDictionary = null;
    private static HashSetDictionary hashSetDictionary = null;
    private static DoubleArrayTrieDictionary doubleArrayTrieDictionary = null;

    public static ArrayListDictionary getArrayListDictionary() {
        if (arrayListDictionary == null) {
            arrayListDictionary = new ArrayListDictionary();
        }
        return arrayListDictionary;
    }

    public static LinkedListDictionary getLinkedListDictionary() {
        if (linkedListDictionary == null) {
            linkedListDictionary = new LinkedListDictionary();
        }
        return linkedListDictionary;
    }

    public static HashSetDictionary getHashSetDictionary() {
        if (hashSetDictionary == null) {
            hashSetDictionary = new HashSetDictionary();
        }
        return hashSetDictionary;
    }

    public static DoubleArrayTrieDictionary getDoubleArrayTrieDictionary() {
        if (doubleArrayTrieDictionary == null) {
            doubleArrayTrieDictionary = new DoubleArrayTrieDictionary();
        }
        return doubleArrayTrieDictionary;
    }
}
